package com.neutech.maplestory.util;

import java.awt.*;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description: TODO(静态加载图片中所有项目资源)
 * @Author ${秦}
 * @Date 2021/1/27 17:46
 */
public class ImageUtil {
    public static Map<String, Image> imagesMap = new HashMap<>();
    static {
        //LOGO
        imagesMap.put("LOGO",GameUtil.getImage("icon/logo"));
        //hero right stand
        for (int i = 0; i < 4; i++) {
            imagesMap.put("hero_right_stand" + i,GameUtil.getImage("hero/right/stand/stand1_" +  i));
        }
        //hero left right
        for (int i = 0; i < 4; i++) {
            imagesMap.put("hero_left_stand" + i,GameUtil.getImage("hero/left/stand/stand1_" +  i));
        }
        for (int i = 0; i < 5; i++) {
            imagesMap.put("hero_left_walk" + i,GameUtil.getImage("hero/left/walk/walk1_" +  i));
        }
        for (int i = 0; i < 5; i++) {
            imagesMap.put("hero_right_walk" + i,GameUtil.getImage("hero/right/walk/walk1_" +  i));
        }
        //hero left right prone
        imagesMap.put("hero_right_prone",GameUtil.getImage("hero/right/prone/prone_0"));
        imagesMap.put("hero_left_prone",GameUtil.getImage("hero/left/prone/prone_0"));
        //hero left right jump
        imagesMap.put("hero_right_jump",GameUtil.getImage("hero/right/jump/jump_0"));
        imagesMap.put("hero_left_jump",GameUtil.getImage("hero/left/jump/jump_0"));

    }
    private ImageUtil(){}

    /*
    * 通过图片对象的key键获取图片对象
    * */
    public static Image getImage(String key){
        return imagesMap.get(key);
    }

}
